package cn.lotusnut.rabbitmqboot.delay;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @Author JiangMing Zhou
 * @Date 2022/12/1 16:20
 * @Version 1.8
 */
@Component
public class DelayConsumer {

    /**
     * 消费消息
     * @param message
     */
    @RabbitListener(queues = "delay_queue")
    public void consumer(Message message){
        System.out.println("延迟队列接收到消息："+new Date());
        System.out.println("延迟队列接收到消息："+message);
    }
}
